home *** CD-ROM | disk | FTP | other *** search
- onClipEvent(enterFrame){
- _root.framesSinceLastExplosion = _root.framesSinceLastExplosion + 1;
- if(shielded)
- {
- _root.shield._x = this._x;
- _root.shield._y = this._y;
- }
- if(!_root.landing)
- {
- if(_root.globaltime * 60 > 2)
- {
- living = _root.checkAlive(this);
- }
- if(living)
- {
- if(this._rotation == 0)
- {
- if(Key.isDown(17) && !_root.gamePaused)
- {
- if(framesSinceLastSecondaryShot >= 10)
- {
- if(_root.secondary.getValue() == "mis1" && _root.sec_weapon_indc.unguided_pool > 0)
- {
- _root.sec_weapon_indc.unguided_pool--;
- if(heli.rl == "in")
- {
- _root.heli.rocketlauncher.gotoAndPlay("out");
- }
- rocketlauncher.flash.play();
- currentProjectile = _root.missile_unguided.duplicateMovieClip("projectile_" + ++projectileCount,o++);
- currentProjectile.moveX = 15;
- currentProjectile._x = this._x + 40;
- currentProjectile._y = this._y + 25;
- _root.projectileArray.push(currentProjectile);
- _root.missile_sound.start();
- _root.shots = _root.shots + 1;
- if(_root.sec_weapon_indc.unguided_pool == 0)
- {
- checkForOtherWeapon();
- }
- }
- if(_root.secondary.getValue() == "nuke" && _root.sec_weapon_indc.nuke_pool > 0)
- {
- _root.sec_weapon_indc.nuke_pool--;
- currentProjectile = _root.nuke.duplicateMovieClip("projectile_" + ++projectileCount,o++);
- currentProjectile.gotoAndPlay(2);
- currentProjectile.moveX = 15;
- currentProjectile._x = this._x - 10;
- currentProjectile._y = this._y + 20;
- _root.projectileArray.push(currentProjectile);
- _root.goingdown_sound.start();
- _root.shots = _root.shots + 1;
- if(_root.sec_weapon_indc.nuke_pool == 0)
- {
- checkForOtherWeapon();
- }
- }
- if(_root.secondary.getValue() == "mine" && _root.sec_weapon_indc.mines_pool > 0)
- {
- _root.sec_weapon_indc.mines_pool--;
- currentmine = _root.mine.duplicateMovieClip("mine_" + ++_root.mineCount,o++);
- currentmine._x = this._x;
- currentmine._y = this._y;
- _root.projectileArray.push(currentmine);
- _root.deploy_sound.start();
- _root.shots = _root.shots + 1;
- if(_root.sec_weapon_indc.mines_pool == 0)
- {
- checkForOtherWeapon();
- }
- }
- if(_root.secondary.getValue() == "mis2" && _root.sec_weapon_indc.guided_pool > 0)
- {
- _root.sec_weapon_indc.guided_pool--;
- _root.missile_sound.start();
- if(heli.rl == "in")
- {
- _root.heli.rocketlauncher.gotoAndPlay("out");
- }
- rocketlauncher.flash.play();
- currentMi = _root.missile.duplicateMovieClip("homingMissile_" + ++_root.missileCount,o++);
- currentMi._x = this._x + 30;
- currentMi._y = this._y + 25;
- currentMi.initSpeed = 5;
- currentMi.initAngle = 0;
- currentMi.step = 0;
- _root.projectileArray.push(currentMi);
- currentMi.initXoffset = currentMi.destX - currentMi._x;
- currentMi.initYoffset = currentMi.destY - currentMi._y;
- _root.shots = _root.shots + 1;
- if(_root.sec_weapon_indc.guided_pool == 0)
- {
- checkForOtherWeapon();
- }
- }
- framesSinceLastSecondaryShot = 0;
- }
- }
- }
- if(Key.isDown(32) && !_root.gamePaused)
- {
- if(_root.laserIsCharged)
- {
- _root.laser._x = this._x + 550;
- _root.laser._y = this._y + 20;
- _root.laser.gotoAndPlay(1);
- _root.bounce_sound.start();
- _root.laserEnabler.gotoAndPlay(1);
- _root.heli.lasergun.gotoAndPlay("retract");
- laserprotect = 0;
- _root.laserIsCharged = false;
- }
- else
- {
- laserprotect++;
- if(laserprotect >= 10 && framesSinceLastShot >= 5)
- {
- _root.shoot();
- framesSinceLastShot = 0;
- }
- }
- }
- }
- }
- if(!_root.landing)
- {
- framesSinceLastShot++;
- framesSinceLastSecondaryShot++;
- if(slowdownX || slowdownY)
- {
- this.moveY /= 1.2;
- this.moveX /= 1.2;
- if(this.moveX <= 1 && this.moveX >= -1)
- {
- this.moveX = 0;
- slowdownX = false;
- }
- if(this.moveY <= 1 && this.moveY >= -1)
- {
- this.moveY = 0;
- slowdownY = false;
- }
- }
- this._x += int(this.moveX);
- this._y += int(this.moveY);
- if(this._x > 510)
- {
- this._x = 510;
- }
- if(this._x < 50)
- {
- this._x = 50;
- }
- if(this._y > 350)
- {
- this._y = 350;
- }
- if(this._y < 10)
- {
- this._y = 10;
- }
- }
- }
-